package com.ny.mapper;

import com.ny.entity.User;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface UserMapper {
     @Select("select * from user")
     public List<User> findAll();


     @Select("select * from user where username=#{username} and password=#{password}")
     public User findUser(String username,String password);

     @Insert("insert into user(username,password)values(#{username}),#{password}")
     public int addUser(String usermame,String password);

     @Delete("delete from user where username=#{username}")
     public int deleteUser(String username);

     @Update("update user set password=#{newPassword} where username=#{username}")
     public int updateUserPassword(String username,String newPassword);
}
